#ifndef __C_GAME_OBJECT_LOADER_H_INCLUDED__
#define __C_GAME_OBJECT_LOADER_H_INCLUDED__

#include "IUnknown.h"
#include "irrString.h"
#include "IGameScene.h"
#include "IDynamicObject.h"
#include "ILocationObject.h"

//#include "ISceneManager.h"
//#include "IVideoHandler.h"
//#include "IGameObject.h"
//#include "IWorldObject.h"
//#include "irrXml.h"
namespace game
{
	namespace scene
	{
		class IGameSceneManager;
		class IDynamicObject;

		class CGameObjectLoader : public irr::IUnknown
		{
		public:
			
			//! Default constructor
			CGameObjectLoader(IGameSceneManager* gameSceneManager);

			//! Destructor
			virtual ~CGameObjectLoader();

			//! Get game scene
			IGameScene* getGameScene(const c8* fileName, irr::core::map<irr::core::stringc, delegateGameSceneCreator*>* creators);
			
			//! Gets dynamic object with specified type
			IDynamicObject* getDynamicObject(const c8* fileName, EGAME_OBJECT_TYPE type);

			//! Load location object from xml file. If you want load world just use this func, but set type "world"
			ILocationObject* getLocationObject(const c8* fileName);

		protected:

			//! Parse properties block
			virtual void parseProperties(irr::io::IrrXMLReader* xml, SGameObjectEntry* resultInfo);

			//! Parse game objects block
			virtual void parseGameObjects(irr::io::IrrXMLReader* xml, SGameObjectEntry* resultInfo);
//
			virtual void parseFile(const c8* fileName, SGameObjectEntry* entry);

			virtual void parseMeshes(irr::io::IrrXMLReader* xml, SDynamicObjectEntry* resultInfo);

			virtual void parseAnimations(irr::io::IrrXMLReader* xml, SDynamicObjectEntry* resultInfo);

			virtual void establishResult(IGameObject* result, SGameObjectEntry* resultInfo);

			//virtual parseDynamicObject();
			
			
			//virtual void parseLocation();
//
//			virtual void parseSize();
//
//			//virtual IWorldObject* establishWorldObject();
//
//			IGameObject* Result;
//			//SGameObjectEntry* ResultInfo;
//
//			irr::io::IrrXMLReader* Xml;
//			irr::core::stringc currentNode;
//
			IGameSceneManager* GameSceneManager;
//			video::IVideoHandler* VideoHandler;
//			irr::scene::ISceneManager* SceneManager;
		};

	}
}
#endif